﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

namespace UI
{
    public class RecycleRewardPage : RushRewardPage 
    {
        public UILabel titleLabel;


        public List<UITweener> tweeners;

        protected override void DoOpen()
        {
            if (options.ContainsKey("type"))
            {
                if (options["type"] == "0")
                {
                    titleLabel.text = TableTextBlo.GetText("recycle_breakup_success");
                }
                else if (options["type"] == "1")
                {
                    titleLabel.text = TableTextBlo.GetText("recycle_reset_success");
                }
            }

            Init(StaticData.recycleReward);

            foreach (var tweener in tweeners)
            {
                if (tweener != null)
                {
                    tweener.ResetToBeginning();
                    tweener.PlayForward();
                }
            }
        }

        protected override void DoClose()
        {
            Clear();
            StaticData.recycleReward = null;
        }
    }
}